@extends('common.layout')
@section('content')
    <!-- 右侧内容区域 -->
    <div class="col-md-9">
    @include('common.validate')
    <!-- 自定义内容区域 -->
        <div class="panel panel-default">
            <div class="panel-heading">修改学生</div>
            <div class="panel-body">
                <form class="form-horizontal" method="post" action="{{url('student/update',['id' => $student->id])}}">
                    <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
                    <div class="form-group">
                        <label for="name" class="col-sm-2 control-label">姓名</label>

                        <div class="col-sm-5">
                            <input type="text" name="student[name]" value="{{old('student')['name'] ? old('student')['name'] : $student->name}}" class="form-control" id="name" placeholder="请输入学生姓名">
                        </div>
                        <div class="col-sm-5">
                            <p class="form-control-static text-danger">{{$errors->first('student.name')}}</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="age" class="col-sm-2 control-label">年龄</label>

                        <div class="col-sm-5">
                            <input type="text" name="student[age]" value="{{old('student')['age'] ? old('student')['age'] : $student->age}}" class="form-control" id="age" placeholder="请输入学生年龄">
                        </div>
                        <div class="col-sm-5">
                            <p class="form-control-static text-danger">{{$errors->first('student.age')}}</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">性别</label>

                        <div class="col-sm-5">
                            <label class="radio-inline">
                                <input type="radio" name="student[sex]" value="10" @if($student->sex == 10) checked @endif> 未知
                            </label>
                            <label class="radio-inline">
                                <input type="radio" name="student[sex]" value="0" @if($student->sex == 0) checked @endif> 男
                            </label>
                            <label class="radio-inline">
                                <input type="radio" name="student[sex]" value="1" @if($student->sex == 1) checked @endif> 女
                            </label>
                        </div>
                        <div class="col-sm-5">
                            <p class="form-control-static text-danger">{{$errors->first('student.sex')}}</p>
                        </div>

                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-10">
                            <button type="submit" class="btn btn-primary">提交</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>

    </div>
@stop